package com.share.framework.starter.properties.shenyu;

import com.share.framework.common.config.shenyu.properties.ShenyuClientConfig;
import com.share.framework.common.config.shenyu.properties.ShenyuRegisterCenterConfig;
import com.share.framework.common.config.shenyu.other.ShenyuClientRegisterRepository;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ShenyuClientCommonBeanConfiguration {
    public ShenyuClientCommonBeanConfiguration() {
    }

    @Bean
    public ShenyuClientRegisterRepository shenyuClientRegisterRepository(ShenyuRegisterCenterConfig config) {
        return new ShenyuClientRegisterRepository();
    }

    @Bean
    @ConfigurationProperties(
            prefix = "shenyu.register"
    )
    public ShenyuRegisterCenterConfig shenyuRegisterCenterConfig() {
        return new ShenyuRegisterCenterConfig();
    }

    @Bean
    @ConfigurationProperties(
            prefix = "shenyu"
    )
    public ShenyuClientConfig shenyuClientConfig() {
        return new ShenyuClientConfig();
    }
}